import request from '@/utils/request'
export function findShipper(query) {
  return request({
    url: '/arpa-basic-api/shipment',
    method: 'get',
    params: query
  })
}
export function commodityType(query) {
  return request({
    url: '/arpa-basic-api/goodsType',
    method: 'get',
    params: query
  })
}
export function insuranceType(query) {
  return request({
    url: '/arpa-basic-api/dict',
    method: 'get',
    params: query
  })
}
export function VehicleType(query) {
  return request({
    url: '/arpa-basic-api/dict',
    method: 'get',
    params: query
  })
}

export function SelectAddress(query) {
  return request({
    url: '/arpa-basic-api/areaProvince/queryList',
    method: 'get',
    params: query
  })
}

export function SelectArea(query) {
  return request({
    url: '/arpa-basic-api/areaCountry/queryList',
    method: 'get',
    params: query
  })
}
export function tedDriver(query) {
  return request({
    url: '/arpa-basic-api/driver/driverList',
    method: 'get',
    params: query
  })
}
export function UpstreamCustomer(query) {
  return request({
    url: '/arpa-basic-api/upstreamCustomer/selectList',
    method: 'get',
    params: query
  })
}

export function releaseSource(data) {
  return request({
    url: '/ntocc-tms-api/order/submitOrder',
    method: 'post',
    data
  })
}

/**
 * 独立司机竞价
 * (string)mainOrderCode：货源order的code
 * (double)bidWeight：每车报价数量(单位:coalUnitName)
 * (double)bidPrice：报价单价：XX元/吨(单位:isTrunkName)
 * (string)arrivalTime：到达时间
 */
export function bidOrder(data) {
  return request({
    url: '/ntocc-tms-api/orderBid/bid',
    method: 'post',
    params: data
  })
}
/**
 * 车队长竞价
 * (string)mainOrderCode：货源order的code
 * (integer)bidCount：车队长报价车数
 * (double)bidWeight：每车报价数量(单位:coalUnitName)
 * (double)bidPrice：报价单价：XX元/吨(单位:isTrunkName)
 * (string)arrivalTime：到达时间
 */
export function bidOrderBatch(data) {
  return request({
    url: '/ntocc-tms-api/orderBid/newMultiBid',
    method: 'post',
    params: data
  })
}
/**
 * 独立司机接单
 * (string)mainOrderCode：货源order的code
 * (double)perWeight：每车接单数量(单位:coalUnitName)
 */

export function takeOrder(data) {
  return request({
    url: '/ntocc-tms-api/orderDetail/receive',
    method: 'post',
    params: data
  })
}
/**
 * 批量接单
 * (string)mainOrderCode：货源order的code
 * (double)perWeight：每车接单数量(单位:coalUnitName)
 * (integer)coalNumber：接单车数
 */
export function takeOrderBatch(data) {
  return request({
    url: '/ntocc-tms-api/orderDetail/newMultiReceive',
    method: 'post',
    params: data
  })
}
export function selectBid(data) {
  return request({
    url: '/ntocc-tms-api/orderBid/selectBid',
    method: 'post',
    params: data
  })
}
export function Gould(data) {
  return request({
    url: '/ntocc-tps-api/amapApi/getGeocodes',
    method: 'post',
    params: data
  })
}

export function SupplyManagement(query) {
  return request({
    url: '/ntocc-tms-api/order/list',
    method: 'get',
    params: query
  })
}
export function pushTarGerList(query) {
  return request({
    url: '/arpa-basic-api/driver/driverList',
    method: 'get',
    params: query
  })
}
export function orderHallList(query) {
  return request({
    url: '/ntocc-tms-api/order/orderHallList',
    method: 'get',
    params: query
  })
}
export function OrderDetails(code) {
  return request({
    url: `/ntocc-tms-api/order/${code}`,
    method: 'get'
  })
}
export function EditOriginalGoods(data) {
  return request({
    url: '/ntocc-tms-api/order/updateOrder',
    method: 'put',
    data
  })
}
export function deleteOrder(data) {
  return request({
    url: `/ntocc-tms-api/order/`,
    method: 'delete',
    params: {
      codes: data
    }
  })
}
export function cancelOrder(data) {
  return request({
    url: '/ntocc-tms-api/order/cancelOrder',
    method: 'put',
    params: {
      codes: data
    }
  })
}
export function orderRefreshApi(data) {
  return request({
    url: '/ntocc-tms-api/order/flushOrder',
    method: 'put',
    params: {
      codes: data
    }
  })
}
export function finishOrder(data) {
  return request({
    url: '/ntocc-tms-api/order/finishOrder',
    method: 'put',
    params: {
      codes: data
    }
  })
}
export function dispatchOrder(data) {
  return request({
    url: '/ntocc-tms-api/order/dispatchOrder',
    method: 'put',
    params: data
  })
}

export function savePushTarget(data) {
  return request({
    url: '/ntocc-tms-api/order/savePushTarget',
    method: 'put',
    params: data
  })
}
export function commonRouteInfo(query) {
  return request({
    url: '/arpa-basic-api/commonRouteInfo',
    method: 'get',
    params: query
  })
}
export function OrderCode(code) {
  return request({
    url: `/arpa-basic-api/commonRouteInfo/${code}`,
    method: 'get'
  })
}
export function driverBidList(query) {
  return request({
    url: '/ntocc-tms-api/orderBid/driverBidList',
    method: 'get',
    params: query
  })
}
export function ModifyPrice(data) {
  return request({
    url: '/ntocc-tms-api/order/releaseOrder',
    method: 'put',
    params: data
  })
}
// 货原单调价
export function ModifypriceApi(data) {
  return request({
    url: '/ntocc-tms-api/order/updateOrderPrice',
    method: 'put',
    params: data
  })
}

